#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <sstream>

using namespace std;

// 定义二叉树节点
struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

// 根据层次遍历字符串构建二叉树
TreeNode* buildTree(const vector<string>& levelOrder) {
    if (levelOrder.empty() || levelOrder[0] == "null") return nullptr;
    
    // 使用队列来进行层次遍历构建树
    TreeNode* root = new TreeNode(stoi(levelOrder[0]));
    queue<TreeNode*> q;
    q.push(root);
    
    int i = 1;
    while (i < levelOrder.size()) {
        TreeNode* current = q.front();
        q.pop();
        
        if (i < levelOrder.size() && levelOrder[i] != "null") {
            current->left = new TreeNode(stoi(levelOrder[i]));
            q.push(current->left);
        }
        i++;
        
        if (i < levelOrder.size() && levelOrder[i] != "null") {
            current->right = new TreeNode(stoi(levelOrder[i]));
            q.push(current->right);
        }
        i++;
    }
    
    return root;
}

// 中序遍历
void inorderTraversal(TreeNode* root, vector<int>& result) {
    if (root == NULL) return;
    
    // 遍历左子树
    inorderTraversal(root->left, result);
    
    // 访问根节点
    result.push_back(root->val);
    
    // 遍历右子树
    inorderTraversal(root->right, result);
}

// 处理层次遍历字符串，构建树并转换为中序遍历
vector<int> levelOrderToInorder(const string& treeStr) {
    stringstream ss(treeStr);
    string value;
    vector<string> levelOrder;
    
    while (getline(ss, value, ' ')) {
        levelOrder.push_back(value);
    }
    
    // 构建树
    TreeNode* root = buildTree(levelOrder);
    
    // 获取中序遍历结果
    vector<int> inorderResult;
    inorderTraversal(root, inorderResult);
    
    return inorderResult;
}

// 主函数示例
int main() {
    // 示例输入
    string treeStr1;
    cin >> treeStr1;
    
    vector<int> inorder1 = levelOrderToInorder(treeStr1);

    for (int i=0;i<inorder1.size()-1;i++){
        if (inorder1[i]>=inorder1[i+1]){printf("false\n");return 0;}

    }
    printf("true\n");
    return 0;
}
